﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/TempAdmin.master" AutoEventWireup="true" CodeFile="NewsManage.aspx.cs" Inherits="admin_NewsManage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentRight" Runat="Server">
    <form id="form1" runat="server">
    <table>
        <tr>
            <td>
                  <img src="../img/pixel_trans.gif" height="10px" />
            </td>
        </tr>
        <tr>
            <td align="center" colspan="2">
                <asp:Label Font-Size="Large" id="lblHeader" ForeColor="Black" Font-Bold="true" runat="server" Text="Danh sách tin tức"></asp:Label>
            </td>
        </tr>
         <tr>
            <td>
                  <img src="../img/pixel_trans.gif" height="10px" />
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Label ID="lblTextMessage" runat="server" ForeColor="Black"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                  <img src="../img/pixel_trans.gif" height="10px" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:GridView ID="gvNews" runat="server" AutoGenerateColumns="False" ForeColor="Black" 
                    DataKeyNames="NewID" DataSourceID="odsNews" 
                    onselectedindexchanged="gvNews_SelectedIndexChanged" 
                    onrowdeleting="gvNews_RowDeleting">
                    <Columns>
                        <asp:BoundField HeaderStyle-HorizontalAlign="Center" DataField="NewID" HeaderText="NewID" InsertVisible="False" 
                            ReadOnly="True" SortExpression="NewID" >
                            <ItemStyle ForeColor="Black" HorizontalAlign="Center"/> 
                        </asp:BoundField>
                        <asp:BoundField  HeaderStyle-HorizontalAlign="Center"  DataField="Title" HeaderText="Title" SortExpression="Title" >
                            <ItemStyle ForeColor="Black" HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField  HeaderStyle-HorizontalAlign="Center"  DataField="BriefDesc" HeaderText="BriefDesc" 
                            SortExpression="BriefDesc" >
                            <ItemStyle ForeColor="Black" HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:TemplateField>
                        <ItemStyle HorizontalAlign ="Center" />
                        <ItemTemplate>
                            <asp:LinkButton ID="lbUpdate" runat="server" style="color:Blue; font-family: tahoma; text-decoration: none" CommandName="select">&nbsp;&nbsp;&nbsp;&nbsp;Chi 
                            tiết [&gt;&gt;]</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemStyle HorizontalAlign ="Center" />
                        <ItemTemplate>
                            <asp:LinkButton ID="lbDelete" runat="server" style=" color:Blue; font-family:tahoma; text-decoration: none" OnClientClick='return confirm("Bạn có chắc chắn muốn xóa sản phẩm này không ?")' CommandName="delete">&nbsp;&nbsp;&nbsp;&nbsp;Xóa 
                            [x]</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                        
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <asp:ObjectDataSource ID="odsNews" runat="server" DeleteMethod="Delete" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllNews" 
                    TypeName="BonSaiTableAdapters.NewsTableAdapter">
                    <DeleteParameters>
                        <asp:Parameter Name="Original_NewID" Type="Int32" />
                    </DeleteParameters>
                </asp:ObjectDataSource>                
            </td>
        </tr>
    </table>
    </form>
</asp:Content>

